<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/admin/goods/goodslist" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>
<body>
  <div class="page">
    <div class="page-hd">
      <h1>商品管理</h1>
    </div>
    <div class="filterbar">
      <form id="search" action="{:URL('admin/Goods/Goodslist')}" method="post">
        <label for="">商品名称</label>
        <input type="text" name="name" id="name" value="{$name}" class="input-text">
        <label for="">商品分类</label>
        <select name ="cate_id"  id="cate_id"  class ="J_tbcats">
           <option  value="">全部分类</option>
           <option  value="0">未分类</option>
           <volist name ="item_cate" id="cate">
           <option value= "{$cate.id}" <eq name='cate_id' value='cate.id'>selected</eq>> {$cate.name}</option>
           </volist>
        </select>
        <label for="">商品状态</label>
        <select name="status" id="status">
          <option value="4">商品状态</option>
          <option value="0" <eq name='status' value='0'>selected</eq>>已上线</option>
          <option value="1" <eq name='status' value='1'>selected</eq>>已删除</option>
          <option value="2" <eq name='status' value='2'>selected</eq>>已下架</option>
          <option value="3" <eq name='status' value='3'>selected</eq>>新增商品</option>
        </select> 
        <button type="submit" class="btn-search" id="J_search" title="{$Think.lang.search}">
          <i class="icon-search"></i>
        </button>
      </form>
    </div>
    <div class="datas">
      <div class="datas-bd">
        <table class="table">
          <thead>
            <tr>
              <th style="width: 10px">
                <input type="checkbox" class="toggle-all" />
              </th>
              <th style="">商品名称</th>
              <th style="">商品图片</th>
              <th style="">描述</th>
              <th style="width: 40px">价格</th>
              <th style="width: 40px">分类</th>
              <th style="width: 80px">时间</th>
              <th style="width: 80px">操作人</th>
              <th style="width: 60px">状态</th>
              <th style="width: 160px">操作</th>
            </tr>
          </thead>
          <tbody>
            <volist name="data" id="vo">
              <tr data-id="{$vo['id']}" class="toggle">
                <td>
                  <input type="checkbox" name="checkbox" class="toggle" value="{$vo['id']}" />
                </td>
                <td>{$vo['name']}</td>
                <td>
                 <img  style="margin:5px; opacity:1;width:100px;height:100px" src="{$vo['imgs']}"  />
                </td>
                <td>{$vo['desc']}</td>
                <td>{$vo['price']}</td>
                <td>{$vo['cate_name']}</td>
                <td><php> echo date('Y-m-d',$vo['created']);</php></td>
                <td>{$vo['username']}</td>
                 
                 <td  id="is_del{$vo['id']}">
                  <eq name='vo.is_del' value='0'>已上线</eq>
                  <eq name='vo.is_del' value='1'>已删除</eq>
                  <eq name='vo.is_del' value='2'>已下架</eq>
                  <eq name='vo.is_del' value='3'>新增商品</eq>
                 </td>
                 
                <td><a href="javascript:;" onclick="javascript:window.location.href='{:URL('admin/Goods/addGoods','id='.$vo['id'].'')}'">{$Think.lang.editor}</a>
                 <eq name='vo.is_del' value='0'>
                  | <a href="javascript:;" id="A_downgoods">下架</a>
                  </eq>
                 <eq name='vo.is_del' value='2'>
                  | <a href="javascript:;" id="A_upgoods">上线</a>
                 </eq>
                 <eq name='vo.is_del' value='3'>
                  | <a href="javascript:;" id="A_upgoods">上线</a>
                 </eq>
                 <php>if($vo['is_del'] == 1){</php>
                  | <a href="javascript:;" class="A_dodel">永久删除</a>
                  <php>}else{</php>
                  | <a href="javascript:;" class="A_del">删除</a>
                  <php>}</php>
                </td>
              </tr>
            </volist>
          </tbody>
        </table>
      </div>
      <div class="datas-ft">
        <div class="actions">
          <a href="{:URL('admin/Goods/addGoods')}" class="btn">添加商品</a>
          <eq name='status' value='0'>
          <a href="#" class="btn" id="J_batchdown">批量下架</a>
          </eq>
          <eq name='status' value='2'>
          <a href="#" class="btn" id="J_batchup">批量上线</a>
          </eq>
          <eq name='status' value='3'>
          <a href="#" class="btn" id="J_batchup">批量上线</a>
          </eq>
          <php>if($status == 1){</php>
          <a href="#" class="btn" id="J_dodel">批量永久删除</a>
          <php>}else{</php>
               <a href="#" class="btn" id="J_del">批量删除商品</a>
          <php>}</php>
        </div>
        <div class="pager">{$page}</div>
      </div>
    </div>
  </div>
</body>

</html>
